package cn.yuhao.party.user.service;

import java.sql.SQLException;

import cn.yuhao.party.pager.PageBean;
import cn.yuhao.party.user.dao.UserDao;
import cn.yuhao.party.user.domain.User;

public class UserService {
	private UserDao userDao = new UserDao();

	public User login(User formUser) {
		try {

			return userDao
					.login(formUser.getGusername(), formUser.getGpwd());

		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}

	public PageBean<User> findAll(int pc) {
		return userDao.findAll(pc);
	}

	public void level(String username, int lev) {
		userDao.level(username,lev);
		
	}
}
